3.5.54 \(\int \frac {\cot ^4(c+d x)}{a+b \sin ^2(c+d x)} \, dx\) [454]

Optimal. Leaf size=71 \[ \frac {(a+b)^{3/2} \tan ^{-1}\left (\frac {\sqrt {a+b} \tan (c+d x)}{\sqrt {a}}\right )}{a^{5/2} d}+\frac {(a+b) \cot (c+d x)}{a^2 d}-\frac {\cot ^3(c+d x)}{3 a d} \]

[Out]

(a+b)^(3/2)*arctan((a+b)^(1/2)*tan(d*x+c)/a^(1/2))/a^(5/2)/d+(a+b)*cot(d*x+c)/a^2/d-1/3*cot(d*x+c)^3/a/d

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 71, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3274, 331, 211} \begin {gather*} \frac {(a+b)^{3/2} \text {ArcTan}\left (\frac {\sqrt {a+b} \tan (c+d x)}{\sqrt {a}}\right )}{a^{5/2} d}+\frac {(a+b) \cot (c+d x)}{a^2 d}-\frac {\cot ^3(c+d x)}{3 a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]^4/(a + b*Sin[c + d*x]^2),x]

[Out]

((a + b)^(3/2)*ArcTan[(Sqrt[a + b]*Tan[c + d*x])/Sqrt[a]])/(a^(5/2)*d) + ((a + b)*Cot[c + d*x])/(a^2*d) - Cot[
c + d*x]^3/(3*a*d)

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 331

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c*x)^(m + 1)*((a + b*x^n)^(p + 1)/(a*c
*(m + 1))), x] - Dist[b*((m + n*(p + 1) + 1)/(a*c^n*(m + 1))), Int[(c*x)^(m + n)*(a + b*x^n)^p, x], x] /; Free
Q[{a, b, c, p}, x] && IGtQ[n, 0] && LtQ[m, -1] && IntBinomialQ[a, b, c, n, m, p, x]

Rule 3274

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.)*((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> With[{ff
 = FreeFactors[Tan[e + f*x], x]}, Dist[ff/f, Subst[Int[(d*ff*x)^m*((a + (a + b)*ff^2*x^2)^p/(1 + ff^2*x^2)^(p
+ 1)), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, d, e, f, m}, x] && IntegerQ[p]

Rubi steps

\begin {align*} \int \frac {\cot ^4(c+d x)}{a+b \sin ^2(c+d x)} \, dx &=\frac {\text {Subst}\left (\int \frac {1}{x^4 \left (a+(a+b) x^2\right )} \, dx,x,\tan (c+d x)\right )}{d}\\ &=-\frac {\cot ^3(c+d x)}{3 a d}-\frac {(a+b) \text {Subst}\left (\int \frac {1}{x^2 \left (a+(a+b) x^2\right )} \, dx,x,\tan (c+d x)\right )}{a d}\\ &=\frac {(a+b) \cot (c+d x)}{a^2 d}-\frac {\cot ^3(c+d x)}{3 a d}+\frac {(a+b)^2 \text {Subst}\left (\int \frac {1}{a+(a+b) x^2} \, dx,x,\tan (c+d x)\right )}{a^2 d}\\ &=\frac {(a+b)^{3/2} \tan ^{-1}\left (\frac {\sqrt {a+b} \tan (c+d x)}{\sqrt {a}}\right )}{a^{5/2} d}+\frac {(a+b) \cot (c+d x)}{a^2 d}-\frac {\cot ^3(c+d x)}{3 a d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.22, size = 72, normalized size = 1.01 \begin {gather*} \frac {3 (a+b)^{3/2} \tan ^{-1}\left (\frac {\sqrt {a+b} \tan (c+d x)}{\sqrt {a}}\right )+\sqrt {a} \cot (c+d x) \left (4 a+3 b-a \csc ^2(c+d x)\right )}{3 a^{5/2} d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]^4/(a + b*Sin[c + d*x]^2),x]

[Out]

(3*(a + b)^(3/2)*ArcTan[(Sqrt[a + b]*Tan[c + d*x])/Sqrt[a]] + Sqrt[a]*Cot[c + d*x]*(4*a + 3*b - a*Csc[c + d*x]
^2))/(3*a^(5/2)*d)

________________________________________________________________________________________

Maple [A]
time = 0.57, size = 79, normalized size = 1.11

method result size
derivativedivides \(\frac {\frac {\left (a^{2}+2 a b +b^{2}\right ) \arctan \left (\frac {\tan \left (d x +c \right ) \left (a +b \right )}{\sqrt {a \left (a +b \right )}}\right )}{a^{2} \sqrt {a \left (a +b \right )}}-\frac {1}{3 a \tan \left (d x +c \right )^{3}}-\frac {-a -b}{a^{2} \tan \left (d x +c \right )}}{d}\) \(79\)
default \(\frac {\frac {\left (a^{2}+2 a b +b^{2}\right ) \arctan \left (\frac {\tan \left (d x +c \right ) \left (a +b \right )}{\sqrt {a \left (a +b \right )}}\right )}{a^{2} \sqrt {a \left (a +b \right )}}-\frac {1}{3 a \tan \left (d x +c \right )^{3}}-\frac {-a -b}{a^{2} \tan \left (d x +c \right )}}{d}\) \(79\)
risch \(\frac {2 i \left (6 a \,{\mathrm e}^{4 i \left (d x +c \right )}+3 b \,{\mathrm e}^{4 i \left (d x +c \right )}-6 a \,{\mathrm e}^{2 i \left (d x +c \right )}-6 b \,{\mathrm e}^{2 i \left (d x +c \right )}+4 a +3 b \right )}{3 d \,a^{2} \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}+\frac {\sqrt {-a \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i \sqrt {-a \left (a +b \right )}-2 a -b}{b}\right )}{2 a^{2} d}+\frac {\sqrt {-a \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i \sqrt {-a \left (a +b \right )}-2 a -b}{b}\right ) b}{2 a^{3} d}-\frac {\sqrt {-a \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i \sqrt {-a \left (a +b \right )}+2 a +b}{b}\right )}{2 a^{2} d}-\frac {\sqrt {-a \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-\frac {2 i \sqrt {-a \left (a +b \right )}+2 a +b}{b}\right ) b}{2 a^{3} d}\) \(275\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)^4/(a+sin(d*x+c)^2*b),x,method=_RETURNVERBOSE)

[Out]

1/d*((a^2+2*a*b+b^2)/a^2/(a*(a+b))^(1/2)*arctan(tan(d*x+c)*(a+b)/(a*(a+b))^(1/2))-1/3/a/tan(d*x+c)^3-1/a^2*(-a
-b)/tan(d*x+c))

________________________________________________________________________________________

Maxima [A]
time = 0.56, size = 76, normalized size = 1.07 \begin {gather*} \frac {\frac {3 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \arctan \left (\frac {{\left (a + b\right )} \tan \left (d x + c\right )}{\sqrt {{\left (a + b\right )} a}}\right )}{\sqrt {{\left (a + b\right )} a} a^{2}} + \frac {3 \, {\left (a + b\right )} \tan \left (d x + c\right )^{2} - a}{a^{2} \tan \left (d x + c\right )^{3}}}{3 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^4/(a+b*sin(d*x+c)^2),x, algorithm="maxima")

[Out]

1/3*(3*(a^2 + 2*a*b + b^2)*arctan((a + b)*tan(d*x + c)/sqrt((a + b)*a))/(sqrt((a + b)*a)*a^2) + (3*(a + b)*tan
(d*x + c)^2 - a)/(a^2*tan(d*x + c)^3))/d

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 151 vs. \(2 (61) = 122\).
time = 0.43, size = 402, normalized size = 5.66 \begin {gather*} \left [\frac {4 \, {\left (4 \, a + 3 \, b\right )} \cos \left (d x + c\right )^{3} + 3 \, {\left ({\left (a + b\right )} \cos \left (d x + c\right )^{2} - a - b\right )} \sqrt {-\frac {a + b}{a}} \log \left (\frac {{\left (8 \, a^{2} + 8 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{4} - 2 \, {\left (4 \, a^{2} + 5 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{2} - 4 \, {\left ({\left (2 \, a^{2} + a b\right )} \cos \left (d x + c\right )^{3} - {\left (a^{2} + a b\right )} \cos \left (d x + c\right )\right )} \sqrt {-\frac {a + b}{a}} \sin \left (d x + c\right ) + a^{2} + 2 \, a b + b^{2}}{b^{2} \cos \left (d x + c\right )^{4} - 2 \, {\left (a b + b^{2}\right )} \cos \left (d x + c\right )^{2} + a^{2} + 2 \, a b + b^{2}}\right ) \sin \left (d x + c\right ) - 12 \, {\left (a + b\right )} \cos \left (d x + c\right )}{12 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} - a^{2} d\right )} \sin \left (d x + c\right )}, \frac {2 \, {\left (4 \, a + 3 \, b\right )} \cos \left (d x + c\right )^{3} - 3 \, {\left ({\left (a + b\right )} \cos \left (d x + c\right )^{2} - a - b\right )} \sqrt {\frac {a + b}{a}} \arctan \left (\frac {{\left ({\left (2 \, a + b\right )} \cos \left (d x + c\right )^{2} - a - b\right )} \sqrt {\frac {a + b}{a}}}{2 \, {\left (a + b\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right )}\right ) \sin \left (d x + c\right ) - 6 \, {\left (a + b\right )} \cos \left (d x + c\right )}{6 \, {\left (a^{2} d \cos \left (d x + c\right )^{2} - a^{2} d\right )} \sin \left (d x + c\right )}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^4/(a+b*sin(d*x+c)^2),x, algorithm="fricas")

[Out]

[1/12*(4*(4*a + 3*b)*cos(d*x + c)^3 + 3*((a + b)*cos(d*x + c)^2 - a - b)*sqrt(-(a + b)/a)*log(((8*a^2 + 8*a*b
+ b^2)*cos(d*x + c)^4 - 2*(4*a^2 + 5*a*b + b^2)*cos(d*x + c)^2 - 4*((2*a^2 + a*b)*cos(d*x + c)^3 - (a^2 + a*b)
*cos(d*x + c))*sqrt(-(a + b)/a)*sin(d*x + c) + a^2 + 2*a*b + b^2)/(b^2*cos(d*x + c)^4 - 2*(a*b + b^2)*cos(d*x
+ c)^2 + a^2 + 2*a*b + b^2))*sin(d*x + c) - 12*(a + b)*cos(d*x + c))/((a^2*d*cos(d*x + c)^2 - a^2*d)*sin(d*x +
 c)), 1/6*(2*(4*a + 3*b)*cos(d*x + c)^3 - 3*((a + b)*cos(d*x + c)^2 - a - b)*sqrt((a + b)/a)*arctan(1/2*((2*a
+ b)*cos(d*x + c)^2 - a - b)*sqrt((a + b)/a)/((a + b)*cos(d*x + c)*sin(d*x + c)))*sin(d*x + c) - 6*(a + b)*cos
(d*x + c))/((a^2*d*cos(d*x + c)^2 - a^2*d)*sin(d*x + c))]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cot ^{4}{\left (c + d x \right )}}{a + b \sin ^{2}{\left (c + d x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)**4/(a+b*sin(d*x+c)**2),x)

[Out]

Integral(cot(c + d*x)**4/(a + b*sin(c + d*x)**2), x)

________________________________________________________________________________________

Giac [A]
time = 0.51, size = 120, normalized size = 1.69 \begin {gather*} \frac {\frac {3 \, {\left (\pi \left \lfloor \frac {d x + c}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a + 2 \, b\right ) + \arctan \left (\frac {a \tan \left (d x + c\right ) + b \tan \left (d x + c\right )}{\sqrt {a^{2} + a b}}\right )\right )} {\left (a^{2} + 2 \, a b + b^{2}\right )}}{\sqrt {a^{2} + a b} a^{2}} + \frac {3 \, a \tan \left (d x + c\right )^{2} + 3 \, b \tan \left (d x + c\right )^{2} - a}{a^{2} \tan \left (d x + c\right )^{3}}}{3 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^4/(a+b*sin(d*x+c)^2),x, algorithm="giac")

[Out]

1/3*(3*(pi*floor((d*x + c)/pi + 1/2)*sgn(2*a + 2*b) + arctan((a*tan(d*x + c) + b*tan(d*x + c))/sqrt(a^2 + a*b)
))*(a^2 + 2*a*b + b^2)/(sqrt(a^2 + a*b)*a^2) + (3*a*tan(d*x + c)^2 + 3*b*tan(d*x + c)^2 - a)/(a^2*tan(d*x + c)
^3))/d

________________________________________________________________________________________

Mupad [B]
time = 15.09, size = 64, normalized size = 0.90 \begin {gather*} \frac {\mathrm {atan}\left (\frac {\mathrm {tan}\left (c+d\,x\right )\,\sqrt {a+b}}{\sqrt {a}}\right )\,{\left (a+b\right )}^{3/2}}{a^{5/2}\,d}-\frac {\frac {1}{3\,a}-\frac {{\mathrm {tan}\left (c+d\,x\right )}^2\,\left (a+b\right )}{a^2}}{d\,{\mathrm {tan}\left (c+d\,x\right )}^3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(c + d*x)^4/(a + b*sin(c + d*x)^2),x)

[Out]

(atan((tan(c + d*x)*(a + b)^(1/2))/a^(1/2))*(a + b)^(3/2))/(a^(5/2)*d) - (1/(3*a) - (tan(c + d*x)^2*(a + b))/a
^2)/(d*tan(c + d*x)^3)

________________________________________________________________________________________